package Composite;

import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.FlowPane;

public class ComponentPatternMain {

	public Scene getStage() {
		SafeFolder safeFileManager = new SafeFolder("安全文件管理器");
		FlowPane pane = new FlowPane();
		BorderPane borderPane = new BorderPane();

		Button button1a = new Button("新建节点sa");
		button1a.setOnMouseClicked(e->{
			SafeFolder sa = new SafeFolder("sa");
			safeFileManager.add(sa);
		});
		Button button1b = new Button("新建节点sb");
		button1b.setOnMouseClicked(e->{
			SafeFolder sa = new SafeFolder("sb");
			safeFileManager.add(sa);
		});
		Button button1c = new Button("新建节点sc");
		button1c.setOnMouseClicked(e->{
			SafeFolder sa = new SafeFolder("sc");
			safeFileManager.add(sa);
		});

		Button button2 = new Button("显示节点");
		button2.setOnMouseClicked(e->{
			safeFileManager.operate();
		});

		pane.getChildren().addAll(button1a, button1b, button1c);
		borderPane.setCenter(pane);
		borderPane.setBottom(button2);
		pane.setPadding(new Insets(50, 50, 50, 50));
		Scene scene = new Scene(borderPane, 400, 300);
		return scene;
	}
}
